package net.dopan.pigframe.api.fegin;

import net.dopan.pigframe.api.fegin.fallback.UserServiceFallbackImpl;
import net.dopan.pigframe.config.FeignDisableHystrixConfiguration;
import net.dopan.pigframe.core.base.controller.response.ResponseBean;
import net.dopan.pigframe.core.interceptor.FeignOauth2RequestInterceptor;
import net.dopan.pigframe.core.model.UserVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @Package: net.dopan.pigframe.api.fegin
 * @Title: UserServiceApi
 * @Description: 用户服务接口
 * @author: 刘宽
 * @date: 2018/9/7 17:15
 */
@FeignClient(name = "userCenter", fallback = UserServiceFallbackImpl.class, configuration = {FeignDisableHystrixConfiguration.class, FeignOauth2RequestInterceptor.class})
public interface UserServiceApi {
    /**
     * 通过用户名查询用户、角色信息
     *
     * @param username 用户名
     * @return UserVo
     */
    @GetMapping("/user/findUserByUsername/{username}")
    UserVO findUserByUsername(@PathVariable("username") String username);

    /**
     * 通过手机号查询用户、角色信息
     *
     * @param mobile 手机号
     * @return UserVo
     */
    @GetMapping("/user/findUserByMobile/{mobile}")
    UserVO findUserByMobile(@PathVariable("mobile") String mobile);

    /**
     * 根据OpenId查询用户信息
     * @param openId openId
     * @return UserVo
     */
    @GetMapping("/user/findUserByOpenId/{openId}")
    UserVO findUserByOpenId(@PathVariable("openId") String openId);

    /**
     * 根据userId查看用户验证信息
     */
    //@GetMapping("/user/getIdentityVerification/{userId}")
    //ResponseBean getIdentityVerification(@PathVariable String userId);
}
